#include "AnimatedTile.h"

AnimatedTile::AnimatedTile(unsigned short tileSize, sf::Vector2f& position, sf::Texture& tile, unsigned short type) : Tile(tileSize, position, tile, type)
{
	_animation.setAnimationData(0, 0, (tile.getSize().x / tileSize) - 1, 0);
}


AnimatedTile::~AnimatedTile(void){}

void AnimatedTile::update()
{
	_animation.update();
	_base.setTextureRect(sf::IntRect(_animation.getCurrentFrame() * _tileSize, 0, _tileSize, _tileSize));
}